﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Aioms.Dtos;
using Aioms.Models;
using Mapster;

namespace Aioms.Mapper
{
    public class InsprcdListMapper : IRegister
    {
        public void Register(TypeAdapterConfig config)
        {
            config.ForType<TpWorkOrder, InsprcdListDto>()
                .Map(ml => ml.BeginDate, wo => wo.TaskPlan.BeginDate.ToString("yyyy-MM-dd"))
                .Map(ml => ml.Period, wo => wo.Extra + "计划")
                .Map(ml => ml.ShiJianDuan, wo => wo.TaskPlan.BeginTime + "-" + wo.TaskPlan.EndTime)
                .Map(ml => ml.EndTime, wo => wo.SjEndTime)
                .Map(ml => ml.Realnames, wo => wo.SjWxEpRealname);
        }
    }
}
